<template>
  <div class="user-panel">
    <div class="user-logo">
      <img v-logo-error v-if="userLogo" :src="userLogo" alt="" class="logo" />
      <img
        class="logo"
        src="~/assets/images/user-logo/default_logo.jpg"
        alt=""
        v-else
      />
      <div class="user-name_mobile">
        <div class="label">{{ labelLang[locale]?.name }}</div>
        <div class="value">{{ userName }}</div>
      </div>
    </div>
    <div class="details">
      <div class="name">
        <div class="label">{{ labelLang[locale]?.name }}</div>
        <div class="value">{{ userName }}</div>
      </div>
      <div class="salary">
        <div class="label">{{ labelLang[locale]?.salary }}</div>
        <div class="value" v-if="salaryExpecation">
          {{ salaryExpecation }}
        </div>
      </div>
      <div class="position">
        <div class="label">{{ labelLang[locale]?.position }}</div>
        <div class="value" v-if="positionName">{{ positionName }}</div>
      </div>
      <div class="tags">
        <div class="label">{{ labelLang[locale]?.tags }}</div>
        <div class="tags-list">
          <template v-for="(tagList, index) in tags" :key="index">
            <div v-if="tagList && tagList.length">
              <div v-for="(item, index2) in tagList" :key="index2">
                <span>{{ item }}</span>
                <span v-if="index2 !== tagList.length - 1">/</span>
              </div>
            </div>
          </template>
        </div>
      </div>
      <div class="seek">
        <div class="label">{{ labelLang[locale]?.status }}</div>
        <div class="value">
          <span class="status" :class="status == '1' ? '' : 'offline'">{{
            status == "1"
              ? labelLang[locale]?.on_job
              : labelLang[locale]?.off_job
          }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import labelLang from "../lang/UserInfo";

const { locale } = useI18n();

type Props = {
  userLogo: string;
  userName: string;
  salaryExpecation: string;
  positionName: string;
  tags: Array<string[] | undefined>;
  status: string;
};
defineProps<Props>();
</script>
<style scoped lang="less">
.user-panel {
  display: flex;
  gap: 24px;
  .user-logo {
    .user-name_mobile {
      display: none;
    }
  }
  .details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    color: #36434d;
    & > div {
      display: flex;
      align-items: center;
      gap: 20px;
    }
    .salary {
      font-size: 14px;
      color: #36434d;
    }
    .name {
      .value {
        font-size: 16px;
        color: #172026;
      }
    }
    .tags-list {
      display: flex;
      gap: 8px;
      font-size: 12px;
      & > div {
        padding: 4px 8px;
        border-radius: 6px;
        background: #f5f8fa;
        white-space: nowrap;
        display: flex;
      }
    }
    .label {
      width: 100px;
    }
    .seek {
      .status {
        padding: 4px 8px;
        background: rgba(54, 217, 108, 0.1);
        border-radius: 6px 6px 6px 6px;
        font-size: 12px;
        color: #36d96c;
        &.offline {
          background: #eef3f4;
          color: #70818c;
        }
      }
    }
  }
  @media screen and (max-width: 768px) {
    flex-direction: column;
    gap: 82px;
    .user-logo {
      display: flex;
      gap: 82px;
      img.logo {
        width: 246px;
        height: 246px;
      }
      .user-name_mobile {
        display: flex;
        flex-direction: column;
        gap: 20px;
        .label {
          display: none;
        }
        .value {
          font-size: 82px;
          color: #172026;
        }
      }
    }
    .details {
      font-size: 72px;
      gap: 61px;
      & > div {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
      }
      .salary {
        font-size: 72px;
      }
      .label {
        white-space: nowrap;
      }
      .name {
        display: none;
      }
      .tags-list {
        gap: 41px;
        flex-wrap: wrap;
        font-size: 61px;
        & > div {
          white-space: nowrap;
          padding: 20px 41px;
          border-radius: 31px;
        }
      }
      .seek {
        .status {
          padding: 20px 41px;
          border-radius: 31px;
          font-size: 61px;
        }
      }
    }
  }
}
</style>
